(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
qsort(nil) → nil
qsort(cons(x, xs)) → append(qsort(filterlow(x, cons(x, xs))), cons(x, qsort(filterhigh(x, cons(x, xs)))))
filterlow(n, nil) → nil
filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterhigh(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
append(nil, ys) → ys
append(cons(x, xs), ys) → cons(x, append(xs, ys))
Rewrite Strategy: FULL
(1) DecreasingLoopProof (EQUIVALENT transformation)
The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
filterlow(n, cons(0, xs)) →+ filterlow(n, xs)
gives rise to a decreasing loop by considering the right hand sides subterm at position [].
The pumping substitution is [xs / cons(0, xs)].
The result substitution is [ ].
(2) BOUNDS(n^1, INF)
(3) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(4) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
qsort(nil) → nil
qsort(cons(x, xs)) → append(qsort(filterlow(x, cons(x, xs))), cons(x, qsort(filterhigh(x, cons(x, xs)))))
filterlow(n, nil) → nil
filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterhigh(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
ge(x, 0') → true
ge(0', s(x)) → false
ge(s(x), s(y)) → ge(x, y)
append(nil, ys) → ys
append(cons(x, xs), ys) → cons(x, append(xs, ys))
S is empty.
Rewrite Strategy: FULL
(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(6) Obligation:
TRS:
Rules:
qsort(nil) → nil
qsort(cons(x, xs)) → append(qsort(filterlow(x, cons(x, xs))), cons(x, qsort(filterhigh(x, cons(x, xs)))))
filterlow(n, nil) → nil
filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterhigh(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
ge(x, 0') → true
ge(0', s(x)) → false
ge(s(x), s(y)) → ge(x, y)
append(nil, ys) → ys
append(cons(x, xs), ys) → cons(x, append(xs, ys))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
(7) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
qsort,
append,
filterlow,
filterhigh,
geThey will be analysed ascendingly in the following order:
append < qsort
filterlow < qsort
filterhigh < qsort
ge < filterlow
ge < filterhigh
(8) Obligation:
TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
x,
cons(
x,
xs))),
cons(
x,
qsort(
filterhigh(
x,
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
The following defined symbols remain to be analysed:
append, qsort, filterlow, filterhigh, ge
They will be analysed ascendingly in the following order:
append < qsort
filterlow < qsort
filterhigh < qsort
ge < filterlow
ge < filterhigh
(9) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol append.
(10) Obligation:
TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
x,
cons(
x,
xs))),
cons(
x,
qsort(
filterhigh(
x,
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
The following defined symbols remain to be analysed:
ge, qsort, filterlow, filterhigh
They will be analysed ascendingly in the following order:
filterlow < qsort
filterhigh < qsort
ge < filterlow
ge < filterhigh
(11) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
ge(
gen_0':s5_0(
n19_0),
gen_0':s5_0(
n19_0)) →
true, rt ∈ Ω(1 + n19
0)
Induction Base:
ge(gen_0':s5_0(0), gen_0':s5_0(0)) →RΩ(1)
true
Induction Step:
ge(gen_0':s5_0(+(n19_0, 1)), gen_0':s5_0(+(n19_0, 1))) →RΩ(1)
ge(gen_0':s5_0(n19_0), gen_0':s5_0(n19_0)) →IH
true
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(12) Complex Obligation (BEST)
(13) Obligation:
TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
x,
cons(
x,
xs))),
cons(
x,
qsort(
filterhigh(
x,
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Lemmas:
ge(gen_0':s5_0(n19_0), gen_0':s5_0(n19_0)) → true, rt ∈ Ω(1 + n190)
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
The following defined symbols remain to be analysed:
filterlow, qsort, filterhigh
They will be analysed ascendingly in the following order:
filterlow < qsort
filterhigh < qsort
(14) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
filterlow(
gen_0':s5_0(
0),
gen_nil:cons:ys4_0(
n324_0)) →
gen_nil:cons:ys4_0(
0), rt ∈ Ω(1 + n324
0)
Induction Base:
filterlow(gen_0':s5_0(0), gen_nil:cons:ys4_0(0)) →RΩ(1)
nil
Induction Step:
filterlow(gen_0':s5_0(0), gen_nil:cons:ys4_0(+(n324_0, 1))) →RΩ(1)
if1(ge(gen_0':s5_0(0), 0'), gen_0':s5_0(0), 0', gen_nil:cons:ys4_0(n324_0)) →LΩ(1)
if1(true, gen_0':s5_0(0), 0', gen_nil:cons:ys4_0(n324_0)) →RΩ(1)
filterlow(gen_0':s5_0(0), gen_nil:cons:ys4_0(n324_0)) →IH
gen_nil:cons:ys4_0(0)
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(15) Complex Obligation (BEST)
(16) Obligation:
TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
x,
cons(
x,
xs))),
cons(
x,
qsort(
filterhigh(
x,
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Lemmas:
ge(gen_0':s5_0(n19_0), gen_0':s5_0(n19_0)) → true, rt ∈ Ω(1 + n190)
filterlow(gen_0':s5_0(0), gen_nil:cons:ys4_0(n324_0)) → gen_nil:cons:ys4_0(0), rt ∈ Ω(1 + n3240)
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
The following defined symbols remain to be analysed:
filterhigh, qsort
They will be analysed ascendingly in the following order:
filterhigh < qsort
(17) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
filterhigh(
gen_0':s5_0(
0),
gen_nil:cons:ys4_0(
n795_0)) →
gen_nil:cons:ys4_0(
0), rt ∈ Ω(1 + n795
0)
Induction Base:
filterhigh(gen_0':s5_0(0), gen_nil:cons:ys4_0(0)) →RΩ(1)
nil
Induction Step:
filterhigh(gen_0':s5_0(0), gen_nil:cons:ys4_0(+(n795_0, 1))) →RΩ(1)
if2(ge(0', gen_0':s5_0(0)), gen_0':s5_0(0), 0', gen_nil:cons:ys4_0(n795_0)) →LΩ(1)
if2(true, gen_0':s5_0(0), 0', gen_nil:cons:ys4_0(n795_0)) →RΩ(1)
filterhigh(gen_0':s5_0(0), gen_nil:cons:ys4_0(n795_0)) →IH
gen_nil:cons:ys4_0(0)
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(18) Complex Obligation (BEST)
(19) Obligation:
TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
x,
cons(
x,
xs))),
cons(
x,
qsort(
filterhigh(
x,
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Lemmas:
ge(gen_0':s5_0(n19_0), gen_0':s5_0(n19_0)) → true, rt ∈ Ω(1 + n190)
filterlow(gen_0':s5_0(0), gen_nil:cons:ys4_0(n324_0)) → gen_nil:cons:ys4_0(0), rt ∈ Ω(1 + n3240)
filterhigh(gen_0':s5_0(0), gen_nil:cons:ys4_0(n795_0)) → gen_nil:cons:ys4_0(0), rt ∈ Ω(1 + n7950)
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
The following defined symbols remain to be analysed:
qsort
(20) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol qsort.
(21) Obligation:
TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
x,
cons(
x,
xs))),
cons(
x,
qsort(
filterhigh(
x,
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Lemmas:
ge(gen_0':s5_0(n19_0), gen_0':s5_0(n19_0)) → true, rt ∈ Ω(1 + n190)
filterlow(gen_0':s5_0(0), gen_nil:cons:ys4_0(n324_0)) → gen_nil:cons:ys4_0(0), rt ∈ Ω(1 + n3240)
filterhigh(gen_0':s5_0(0), gen_nil:cons:ys4_0(n795_0)) → gen_nil:cons:ys4_0(0), rt ∈ Ω(1 + n7950)
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
No more defined symbols left to analyse.
(22) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
ge(gen_0':s5_0(n19_0), gen_0':s5_0(n19_0)) → true, rt ∈ Ω(1 + n190)
(23) BOUNDS(n^1, INF)
(24) Obligation:
TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
x,
cons(
x,
xs))),
cons(
x,
qsort(
filterhigh(
x,
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Lemmas:
ge(gen_0':s5_0(n19_0), gen_0':s5_0(n19_0)) → true, rt ∈ Ω(1 + n190)
filterlow(gen_0':s5_0(0), gen_nil:cons:ys4_0(n324_0)) → gen_nil:cons:ys4_0(0), rt ∈ Ω(1 + n3240)
filterhigh(gen_0':s5_0(0), gen_nil:cons:ys4_0(n795_0)) → gen_nil:cons:ys4_0(0), rt ∈ Ω(1 + n7950)
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
No more defined symbols left to analyse.
(25) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
ge(gen_0':s5_0(n19_0), gen_0':s5_0(n19_0)) → true, rt ∈ Ω(1 + n190)
(26) BOUNDS(n^1, INF)
(27) Obligation:
TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
x,
cons(
x,
xs))),
cons(
x,
qsort(
filterhigh(
x,
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Lemmas:
ge(gen_0':s5_0(n19_0), gen_0':s5_0(n19_0)) → true, rt ∈ Ω(1 + n190)
filterlow(gen_0':s5_0(0), gen_nil:cons:ys4_0(n324_0)) → gen_nil:cons:ys4_0(0), rt ∈ Ω(1 + n3240)
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
No more defined symbols left to analyse.
(28) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
ge(gen_0':s5_0(n19_0), gen_0':s5_0(n19_0)) → true, rt ∈ Ω(1 + n190)
(29) BOUNDS(n^1, INF)
(30) Obligation:
TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
x,
cons(
x,
xs))),
cons(
x,
qsort(
filterhigh(
x,
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Lemmas:
ge(gen_0':s5_0(n19_0), gen_0':s5_0(n19_0)) → true, rt ∈ Ω(1 + n190)
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
No more defined symbols left to analyse.
(31) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
ge(gen_0':s5_0(n19_0), gen_0':s5_0(n19_0)) → true, rt ∈ Ω(1 + n190)
(32) BOUNDS(n^1, INF)